package com.eps.entity;


import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Diana
 */
@Entity
@Table(name = "SuministroEmpresaZonal")
@NamedQueries({
    @NamedQuery(name = "SuministroEmpresaZonal.findAll", query = "SELECT s FROM SuministroEmpresaZonal s"),
    @NamedQuery(name = "SuministroEmpresaZonal.findByIdSuministro", query = "SELECT s FROM SuministroEmpresaZonal s WHERE s.suministroEmpresaZonalPK.idSuministro = :idSuministro"),
    @NamedQuery(name = "SuministroEmpresaZonal.findByStock", query = "SELECT s FROM SuministroEmpresaZonal s WHERE s.stock = :stock"),
    @NamedQuery(name = "SuministroEmpresaZonal.findByPrecioPromedio", query = "SELECT s FROM SuministroEmpresaZonal s WHERE s.precioPromedio = :precioPromedio"),
    @NamedQuery(name = "SuministroEmpresaZonal.findByValorTotal", query = "SELECT s FROM SuministroEmpresaZonal s WHERE s.valorTotal = :valorTotal"),
    @NamedQuery(name = "SuministroEmpresaZonal.findByIdZona", query = "SELECT s FROM SuministroEmpresaZonal s WHERE s.suministroEmpresaZonalPK.idZona = :idZona")})
public class SuministroEmpresaZonal implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SuministroEmpresaZonalPK suministroEmpresaZonalPK;
    @Column(name = "stock")
    private BigDecimal stock;
    @Column(name = "precioPromedio")
    private BigDecimal precioPromedio;
    @Column(name = "valorTotal")
    private BigDecimal valorTotal;

    public SuministroEmpresaZonal() {
    }

    public SuministroEmpresaZonal(SuministroEmpresaZonalPK suministroEmpresaZonalPK) {
        this.suministroEmpresaZonalPK = suministroEmpresaZonalPK;
    }

    public SuministroEmpresaZonal(String idSuministro, String idZona) {
        this.suministroEmpresaZonalPK = new SuministroEmpresaZonalPK(idSuministro, idZona);
    }

    public SuministroEmpresaZonalPK getSuministroEmpresaZonalPK() {
        return suministroEmpresaZonalPK;
    }

    public void setSuministroEmpresaZonalPK(SuministroEmpresaZonalPK suministroEmpresaZonalPK) {
        this.suministroEmpresaZonalPK = suministroEmpresaZonalPK;
    }

    public BigDecimal getStock() {
        return stock;
    }

    public void setStock(BigDecimal stock) {
        this.stock = stock;
    }

    public BigDecimal getPrecioPromedio() {
        return precioPromedio;
    }

    public void setPrecioPromedio(BigDecimal precioPromedio) {
        this.precioPromedio = precioPromedio;
    }

    public BigDecimal getValorTotal() {
        return valorTotal;
    }

    public void setValorTotal(BigDecimal valorTotal) {
        this.valorTotal = valorTotal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (suministroEmpresaZonalPK != null ? suministroEmpresaZonalPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SuministroEmpresaZonal)) {
            return false;
        }
        SuministroEmpresaZonal other = (SuministroEmpresaZonal) object;
        if ((this.suministroEmpresaZonalPK == null && other.suministroEmpresaZonalPK != null) || (this.suministroEmpresaZonalPK != null && !this.suministroEmpresaZonalPK.equals(other.suministroEmpresaZonalPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.SuministroEmpresaZonal[suministroEmpresaZonalPK=" + suministroEmpresaZonalPK + "]";

    }
}
